<%@ page language="java" pageEncoding="utf-8"%>
<jsp:directive.page import="java.util.Date"/>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />

		<link rel="stylesheet" type="text/css" href="<%=path%>/css/base.css" />
		
		<script>
		  function del(oid){
		    if(confirm("是否删除此数据?")){
		       window.location.href="<%=path%>/kuaijian!del.action?data.id="+oid;
		    }
		  }
		</script>
		
	</head>

	<body leftmargin="2" topmargin="2"
		background='<%=path%>/images/allbg.gif'>

		<table width="98%" border="0" cellpadding="2" cellspacing="1"
			bgcolor="#D1DDAA" align="center" style="margin-top:8px">
			<tr bgcolor="#E7E7E7">
				<!--  <td height="14" colspan="10" background="<%=path%>/images/tbg.gif">
					&nbsp;用户信息&nbsp;
				</td>-->
				
				<form action="<%=path%>/kuaijian!find.action" method="post"
				onsubmit="return check();">
				<td height="14" colspan="12" background="<%=path%>/images/tbg.gif"
					align="right">&nbsp;&nbsp; 
					
					学号:<input name="data.stuno" id="stuno" />
					
					 <input type="submit" value="查询" />
				</td>
			</form>
				
				
			</tr>
			<tr align="center" bgcolor="#FAFAF1" height="22">
				
				<td >
					区域
				</td>
				<td >
					楼栋
				</td>
				<td >
					学号
				</td>
				<td >
					姓名
				</td>
				<td >
					联系方式
				</td>
				<td >
					宿舍号
				</td>
				<td >
					登记日期
				</td>
				<td >
					状态
				</td>

				<td >
					操作
				</td>


			</tr>
			<c:forEach var="data" items="${all}">
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					
					<td bgcolor="#FFFFFF" align="center">
						${data.area}区
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${data.flat}栋
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${data.stuno}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${data.name}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${data.tel}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${data.company}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${data.curtime}
						<c:set var="cur" value="${data.curtime}" scope="request"></c:set>
						
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${data.status==1?"缺寝":"签到"}
					</td>



					<td bgcolor="#FFFFFF" align="center">
                        <%
                          Date curr =  (Date)request.getAttribute("cur");
                          int hour = curr.getHours();
                          int minute = curr.getMinutes();
                          if(hour<=23 && minute<=59){
                         %> 
                           <a href="<%=path%>/kuaijian!change.action?data.id=${data.id }"
							class="pn-loperator">签到</a>
                        <%} %>
						<!--  <a href="<%=path%>/kuaijian!del.action?data.id=${data.id }"
							class="pn-loperator">删除</a>-->
						<a href="#" onclick="del(${data.id });" class="pn-loperator">删除</a>
					</td>


				</tr>
			</c:forEach>
		</table>

	</body>
</html>
